<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
pageContext.setAttribute("basePath",basePath);
%>
<!DOCTYPE html>
<html lang="zh-cn">
	<head>
		<meta charset="UTF-8">
		<title>修改个人信息</title>

		<link rel="stylesheet" type="text/css" href="${basePath}resources/bootstrap/css/bootstrap-responsive.css">
		<link rel="stylesheet" type="text/css" href="${basePath}resources/bootstrap/css/bootstrap.css">
		<link rel="stylesheet" type="text/css" href="${basePath}resources/css/basic.css">
		<link rel="stylesheet" type="text/css" href="${basePath}resources/css/login.css">

		<script type="text/javascript" src="${basePath}resources/js/common/base.js"></script>
		<script type="text/javascript" src="${basePath}resources/js/common/jquery-3.2.1.min.js"></script>
		<script type="text/javascript" src="${basePath}resources/bootstrap/js/bootstrap.js"></script>
		<script type="text/javascript" src="${basePath}resources/angular-1.3.0/angular.min.js"></script>
		<script type="text/javascript" src="${basePath}resources/js/common/jquery-3.2.1.min.js"></script>
		<script type="text/javascript" src="${basePath}resources/js/update_selfinfo.js"></script>
	</head>
	<body ng-app="myApp" ng-controller="updateSelfInfoController">
		<div id="header">
			<%@ include file="common/header.jsp" %>
		</div>
		<div id="container">
			<c:if test="${user != null}">
				<form onsubmit="return false;" method="post">
					<div>
						<input type="hidden" id="userId" name="userId" value="${user.userId}" />
					</div>
					<div>
						<input type="text" id="username" name="username" value="${user.username}" readonly="readonly" />
					</div>
					<div>
						<input type="text" id="truename" name="truename" value="${user.truename}"  />
					</div>
					<div>
						<c:if test="${user.gender == 1}">
							<input type="radio" id="gender" name="gender" value="1" checked />男
						</c:if>
						<c:if test="${user.gender == 2}">
							<input type="radio" id="gender" name="gerder" value="2" checked />女
						</c:if>
						<c:if test="${user.gender != 1}">
							<input type="radio" id="gender" name="gender" value="1" />男
						</c:if>
						<c:if test="${user.gender != 2}">
							<input type="radio" id="gender" name="gender" value="1" />女
						</c:if>
					</div>
					<div>
						<input type="text" id="phone" name="phone" value="${user.phone}" />
					</div>
					<div>
						<input type="text" id="email" name="email" value="${user.email}" readonly="readonly" />
					</div>
					<div>
						<input type="text" id="job" name="job" value="${user.job}" />
					</div>
					<div>
						<input type="submit" class="btn btn-primary" name="updateSelfInfoBtn" value="确认修改" ng-click="updateSelfInfo()" />
					</div>
				</form>
			</c:if>
		</div>
		<div id="footer">
			<%@ include file="common/footer.jsp" %>
		</div>
	</body>
</html>